<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!doctype html>
<html lang="zh-CN">
<head>
<meta content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" name="viewport" />
<meta charset="utf-8">
<title>赚钱嘉年华，乐享三重礼</title>
<script type="text/javascript" src="./js/flexible.js"></script>
<link rel="stylesheet" href="css/normalize.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="activity.js"></script>
<script type="text/javascript" src="js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	$(function() {
		var shareurl = 'http://8.laicunba.com/h5/regist_new.jsp?invite_code=${inviteCode}&mobile=${mobile}&is_noward=' + $(".is_noward").text();
		if($("#channel").val()) {
			shareurl += "&channel=${param.channel}";
		}
		wx.config({
			debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
			appId : '${weiXinVO.appid}', // 必填，公众号的唯一标识
			timestamp :'${weiXinVO.timestamp}', // 必填，生成签名的时间戳
			nonceStr : '${weiXinVO.nonceStr}', // 必填，生成签名的随机串
			signature :'${weiXinVO.signature}',// 必填，签名，见附录1
			 jsApiList: ['onMenuShareQZone',
				'onMenuShareTimeline',
				'onMenuShareAppMessage',
				'onMenuShareQQ',
				'onMenuShareWeibo',
				'hideMenuItems',
				'showMenuItems',
				'hideAllNonBaseMenuItem',
				'showAllNonBaseMenuItem',
				'translateVoice',
				'startRecord',
				'stopRecord',
				'onRecordEnd',
				'playVoice',
				'pauseVoice',
				'stopVoice',
				'uploadVoice',
				'downloadVoice',
				'chooseImage',
				'previewImage',
				'uploadImage',
				'downloadImage',
				'getNetworkType',
				'openLocation',
				'getLocation',
				'hideOptionMenu',
				'showOptionMenu',
				'closeWindow',
				'scanQRCode',
				'chooseWXPay',
				'openProductSpecificView',
				'addCard',
				'chooseCard',
				'openCard']
		// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});

		wx.ready(function() {
			// config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，
			// config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，
			// 则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，
			// 则可以直接调用，不需要放在ready函数中。

			wx.onMenuShareAppMessage({
				title : '要理财,来存吧!', // 分享标题
				desc : '来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!', // 分享描述
				link :shareurl, // 分享链接
				imgUrl : 'http://8.laicunba.com/h5/img/sharelogo.png', // 分享图标
				type : '', // 分享类型,music、video或link，不填默认为link
				dataUrl : '', // 如果type是music或video，则要提供数据链接，默认为空
				success : function() {
					// 用户确认分享后执行的回调函数
				},
				cancel : function() {
					// 用户取消分享后执行的回调函数
				}
			});

			wx.onMenuShareTimeline({
				title : '要理财,来存吧!来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!', // 分享标题
				link : shareurl, // 分享链接
				imgUrl : 'http://8.laicunba.com/h5/img/sharelogo.png', // 分享图标
				success : function() {
					// 用户确认分享后执行的回调函数
				},
				cancel : function() {
					// 用户取消分享后执行的回调函数
				}
			});
			
			wx.onMenuShareQQ({
				title: '要理财,来存吧!', // 分享标题
				desc: '来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!', // 分享描述
				link: shareurl, // 分享链接
				imgUrl: 'http://8.laicunba.com/h5/img/sharelogo.png', // 分享图标
				success : function() {
					// 用户确认分享后执行的回调函数
				},
				cancel : function() {
					// 用户取消分享后执行的回调函数
				}
			});
			
			wx.onMenuShareQZone({
				title: '要理财,来存吧!', // 分享标题
				desc: '来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!', // 分享描述
				link: shareurl, // 分享链接
				imgUrl: 'http://8.laicunba.com/h5/img/sharelogo.png', // 分享图标
				success : function() {
					// 用户确认分享后执行的回调函数
				},
				cancel : function() {
					// 用户取消分享后执行的回调函数
				}
			});

		}); 
	}); 
</script>

<style type="text/css">
*{ margin:0; padding:0; }
a{ color:#0a8cd2; text-decoration:none; outline: none;-webkit-tap-highlight-color:transparent;}
.clearfix:after{ content:"."; display:block; height:0; clear:both; visibility:hidden; }
.clearfix{ display:inline-block; }
.clearfix{ display:block; }
.clear{ clear:both; height:0; font:0/0 Arial; visibility:hidden; }
.none{ display:none }
body,html {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    font-size: 18px;
    font-family: "微软雅黑";
    position: relative;
}
.mb-5 {
    margin-bottom: 5px;
}
img{
	box-sizing: border-box;
	max-width: 100%;
	height: auto;
	vertical-align: middle;
	border: 0;
}
.flex {
	display: flex;
}
.flex-1 {
	flex: 1;
}
.jc-space-between {
	justify-content: space-between;
}
.jc-space-around {
    justify-content: space-around;
}
.jc-center {
	justify-content: center;
}
.ai-center {
	align-items: center;
}
.no-click {
    pointer-events: none;
}
.ernd_wrapper {
   width: 100%;
   background: #5e6ce2 url(http://laicunba.b0.upaiyun.com/lcb/activity/ernd_bg.png) no-repeat center top;
   background-size: cover;
}
.tab {
   width: 3.2rem;
   height: 1.55rem;
   background: url(img/tab_bg.png) no-repeat center top;
   background-size: 100%;
   text-align: center;
   color: #FFF;
   padding-top: 0.16rem;
}
.tab-active {
   background: url(img/tab_bg_on.png) no-repeat center top;
   background-size: 100%;
} 
.con-box {
   width: 9.4rem;
   margin: 0 auto;
   padding-bottom: 0.24rem;
   border-radius: 0.58rem;
   background-color: #fdfdfe;
   -webkit-box-shadow: inset 0 0 7px #fcfcfe;
   -moz-box-shadow: inset 0 0 7px #fcfcfe;
   box-shadow: inset 0 0 7px #fcfcfe;
   border: solid 4px #e4abef;
   box-sizing: border-box;
   color: #9a1d21;
}
li {
   list-style: none;
}
.convert-item {
   width: 3.5rem;
   height: 3.56rem; 
   position: relative;
}
.btn-convert {
   width: 2.32rem;
   height: 0.85rem;
   position: absolute;
   left: 50%;
   margin-left: -1.16rem;
   bottom: 0.6rem;
}
.ver-top {
   vertical-align: top;
}
.act_rules {
   padding: 0 5px;
   color: #9a1d21;
}
.act_rules tr td {
   line-height: 1.5;
   font-size: 14px
}
.con-title {
   margin: 0.33rem; 
   text-align: center;
   font-size: 18px;
   color: #9a1d21;
}
.calc_invest{
	color: #9a1d21;
	font-size: 12px;
	margin: 0.2rem 0 0.4rem 0;
}
.calc_invest input{
	width: 1.75rem;
	height: 0.94rem;
	border: 1px solid #ac5ac6;
	text-align: center;
	font-size: 14px !important;
	background: #e9cffe;
	color: #9a1d21;
	-webkit-tap-highlight-color:rgba(0,0,0,0)
}
input::-webkit-input-placeholder{
	color: #9a1d21 !important;
}
input:-moz-placeholder{
	color: #9a1d21 !important;
}
input:-moz-placeholder, textarea:-moz-placeholder {
　　color: #9a1d21 !important;
}
input:-ms-placeholder{
	color: #9a1d21 !important;
}
.page2-btn, .btn-invite2 {
    width: 3.54rem;
}
.treasurebox {
    width: 5.5rem;
    margin: 0.68rem auto 0.28rem;
}
.tab_con {
    padding-bottom: 1.04rem;
}
.mask,.mask1 {
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9;
    display: none;
}
.popup {
    width: 90%;
    position: fixed;
    left: 5%;
    top: 50%;
    padding: 0.68rem 0;
    z-index: 9;
    background: #FFF;
    text-align: center;
    border-radius: 12px;
    display: none;
}
.act_popup21 {
    width: 90%;
    max-height: 80%;
    position: fixed;
    left: 5%;
    top: 50%;
    z-index: 9;
    background: #FFF;
    border-radius: 12px;
    padding: 0 10%;
    box-sizing: border-box;
    display: none;
}
.act_popup21close {
    position: absolute;
    right: 0;
    top: 0;
    width: 30px;
    height: 30px;
}
.btn_act2close {
    width: 1.72rem;  
    height: 0.8rem;  
    line-height: 0.8rem;
    margin: 0.8rem auto 0;
    color: #FFF;
    background: #9a1d21;
    border-radius: 0.4rem;
}
.box_prize {
    position: absolute;
    width: 2.16rem;
    left: 50%;
    margin-left: -0.82rem;
    top: 0.91rem;
}
.run-turn {
    -o-transform:  transform 6s;
	-ms-transform:  transform 6s;
	-moz-transform:  transform 6s;		
	-webkit-transform:  transform 6s;
	transition: transform 6s;
	-o-transform-origin:  50% 50%;
	-ms-transform-origin:  50% 50%;
	-moz-transform-origin:  50% 50%;		
	-webkit-transform-origin:  50% 50%;
	transform-origin: 50% 50%;
}
.light-pro {
    color: #9a1d21;
    font-size: 16px;
    margin-top: 0.2rem;
}
.dark-pro {
    color: #686868;
    font-size: 14px;
    margin-top: 0.2rem;
}
.btn-invite1,.btn-invite3 {
    width: 7.933333rem;
    margin: 0.58rem auto 5px;
}
.bill-tab {
	background: #FFF;
	color: #9a1d21;
	height: 1.12rem;
	line-height: 1.12rem;
	font-size: 16px;
}
.txt-left {
    text-align: left;
}
.txt-right {
    text-align: right;
}
.maskimg{
	position:fixed;
	left:0;
	top:0;
	z-index:100;
	display:none;
}
.maskimg img{
	width:93%;
}
.btn-run {
    height: 2.74rem;
    width: 2.2rem;
    position: absolute;
    left: 50%;
    margin-left: -1.1rem;
    top: 50%;
    margin-top: -1.37rem;
    z-index: 8;
}
.act-box1, .act-box2, .act-box3 {
    position: relative;
}
.endmask {
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(255,255,255,0.5) url(img/end.png) no-repeat right top;
    z-index: 9;
    width: 100%;
    height: 100%;
    border-radius: 0.58rem;
}
</style>
</head>
<body>
<div class="ernd_wrapper">
     <div style="width: 100%;text-align: center;margin-bottom: 0.9rem;"><img src="img/2nd_banner.png"></div>
     <div class="flex jc-space-between" style="padding: 0 0.16rem;">
          <a class="tab tab-active" href="#tab0">
             <p>伙伴集结来加息</p>
             <p>8.9-8.13</p>
          </a>
          <a class="tab" href="#tab1">
             <p>宝箱大探险</p>
             <p>8.14-8.28</p>
          </a>
          <a class="tab" href="#tab2">
             <p>周年庆快乐</p>
             <p>8.14-8.31</p>
          </a>
     </div>
     <div class="tab_con" >
          <div class="act-start1">
	          <div class="con-box act-box1">
	               <span style="display: none" class="is_noward"></span>
	               <div class="endmask" style="display: none"></div>
	               <div class="con-title">伙伴集结号征程再出发</div>
	               <div class="flex jc-space-between" style="padding: 5px 0.8rem;">
	                    <div class="convert-item">
	                         <img src="img/convert1.png">
	                         <div class="btn-convert" data-type="001"></div>
	                    </div>
	                    <div class="convert-item">
	                         <img src="img/convert2.png">
	                         <div class="btn-convert" data-type="002"></div>
	                    </div>
	               </div>
	               <div class="flex jc-space-between" style="padding: 5px 0.88rem;">
	                    <div class="convert-item">
	                         <img src="img/convert3.png">
	                         <div class="btn-convert" data-type="003"></div>
	                    </div>
	                    <div class="convert-item">
	                         <img src="img/convert4.png">
	                         <div class="btn-convert" data-type="004"></div>
	                    </div>
	               </div>
	               <div class="flex jc-center" style="padding: 5px 0.88rem;">
	                    <div class="convert-item">
	                         <img src="img/convert5.png">
	                         <div class="btn-convert" data-type="005"></div>
	                    </div>
	               </div>
	               <div class="btn-invite1"><img src="img/2nd_invite1.png"></div>
	               <div style="text-align: center;">剩余邀请豆： <span class="invitesoy-numbers">${anniversaryInviteTimesCount!=null ? anniversaryInviteTimesCount : 0 }</span>粒</div>
	          </div>
	          <div class="con-box" style="margin-top: 0.54rem;margin-bottom: 1.04rem;">
	               <div class="con-title">活动规则</div>
	               <table class="act_rules">
	                   <tr>
	                       <td class="ver-top">1、</td>
	                       <td>用户通过点击【召唤好友，即刻兑换】按钮，成功邀请一位好友进行注册并且首次投资任意标的（除随存宝），即可获得一粒邀请豆，依次累计。</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">2、</td>
	                       <td>活动期间，获得的1粒邀请豆可兑换0.5%加息券+50元现金券；2粒邀请豆可兑换0.8%加息券+100元现金券；如活动区所示，累计的邀请豆越多，可兑换的奖励越大。</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">3、</td>
	                       <td>此次活动红包不限兑换次数和张数</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">4、</td>
	                       <td>红包使用说明：<br/>①加息券：有效期48小时，15天以上标的使用；<br/>②现金券：以“10+40”元面值券*N张的形式发放，有效期为15天，20天及以上标的、满2000元使用。</td>
	                   </tr>
	               </table>
	          </div>
	      </div>
	      <div class="act-nobegin1 con-box" style="padding: 20px 0;display: none;"><img src="img/coming-soon.png"></div>
     </div>
     <div class="tab_con none">
          <div class="act-start2">
	          <div class="con-box act-box2" style="min-height: 500px;padding: 0 0.3rem;">
	               <div class="endmask" style="display: none"></div>
	               <div class="con-title">宝箱大冒险&nbsp;&nbsp; 拼的就是人品</div>
	               <div class="flex jc-space-between" style="font-size: 14px;">
	                    <div class="myCurrentVcoin">当前积分： <span class="my_anniversary_vcoin">${anniversaryVcoin }</span></div>
	                    <div class="mygift">我的礼品》</div>
	               </div>
	               <div style="line-height: 1.5;font-size: 14px;">积分计算器</div>
	               <div style="line-height: 1.5;font-size: 14px;">用户通过投资银票宝>15天以上项目，即可获得对应积分</div>
	               <div class="calc_invest flex ai-center">
						<input type="number" id="input_amount" placeholder="投资本金" />&nbsp;&nbsp;*&nbsp;&nbsp; 
						<input type="number" id="input_period" placeholder="投资天数" />&nbsp;/365=&nbsp;
						<input type="number" id="compute_result" readonly="readonly" placeholder="" />&nbsp;积分
					</div>
					<div class="boxcon1">
					     <div class="treasurebox"><img src="img/bronze_box.png"></div>
					     <div class="flex jc-space-around">
					          <div style="text-align: center;">
					               <div class="mb-5">300积分可开启</div>
					               <div class="page2-btn" data-type="001"><img src="img/2nd_open.png"></div>
					          </div>
					          <div style="text-align: center;">
					               <div class="mb-5">邀友开启宝箱机会：${anniversaryOpenBoxChangeCount!=null ? anniversaryOpenBoxChangeCount : 0 }</div>
					               <div class="btn-invite2"><img src="img/2nd_invite2.png"></div>
					          </div>
					     </div>
					</div>
					<div class="boxcon2">
					     <div class="treasurebox"><img src="img/gold_box.png"></div>
					     <div class="flex jc-center">
					          <div style="text-align: center;">
					               <div class="mb-5">5888积分可开启</div>
					               <div class="page2-btn" data-type="002"><img src="img/2nd_open.png"></div>
					          </div>
					     </div>
					</div>
					<div class="boxcon3">
					     <div class="treasurebox"><img src="img/diamond_box.png"></div>
					     <div class="flex jc-center">
					          <div style="text-align: center;">
					               <div class="mb-5">20000积分可开启</div>
					               <div class="page2-btn" data-type="003"><img src="img/2nd_open.png"></div>
					          </div>
					     </div>
					</div>
					<div class="boxcon4" style="margin-bottom: 0.44rem;">
					     <div class="treasurebox"><img src="img/king_box.png"></div>
					     <div class="flex jc-center">
					          <div style="text-align: center;">
					               <div class="mb-5">180000积分可开启</div>
					               <div class="page2-btn" data-type="004"><img src="img/2nd_open.png"></div>
					          </div>
					     </div>
					</div>
	          </div>
	          <div class="con-box" style="margin-top: 0.54rem;margin-bottom: 1.04rem;">
	               <div class="con-title">活动规则</div>
	               <table class="act_rules">
	                   <tr>
	                       <td class="ver-top">1、</td>
	                       <td>用户通过投资银票宝＞15天以上项目，即可获得对应积分，积分=投资本额×天数÷365。满足一定条件的积分可开启相应宝箱，随机获取该宝箱内的礼品</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">2、</td>
	                       <td>8月14日-8月28日，用户通过平台任一【邀请好友】按钮，成功邀请一位好友进行注册并且首次投资任意标的（随存宝除外），邀请人除了获得平台奖励“10+40现金券”外，还可获得一次“宝箱大探险”开启“青铜宝箱”机会+一次“2周年快乐”抽奖机会。</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">3、</td>
	                       <td>开宝箱的机会在活动结束后自动清零，请及时使用。 </td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">4、</td>
	                       <td>红包使用说明 
	                           <table>
	                                <tr>
	                                    <td class="ver-top">①</td>
	                                    <td>5元、10元现金券：投资1500元＞30天以上，有效期自领取之日30天;</td>
	                                </tr>
	                                <tr>
	                                    <td class="ver-top">②</td>
	                                    <td>50元、55元、60元、210元、255元、420元、3200元现金券：投资1000元＞30天以上，有效期自领取之日30天;</td>
	                                </tr>
	                                <tr>
	                                    <td class="ver-top">③</td>
	                                    <td>0.5加息券：投资＞15天以上，有效期自领取之日30天;</td>
	                                </tr>
	                           </table>   
	                       </td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">5、</td>
	                       <td>红包将在抽中后自动发送您的红包账户中；京东E卡将于活动结束后10个工作日内以短信电子卡形式发送到您的注册手机号中,问题受理时间截止9月15号；实物奖励将于活动结束后10个工作日内由客服联系，并获取您的收货地址，为您安排寄出。</td>
	                   </tr>
	               </table>
	          </div>
	      </div>
	      <div class="act-nobegin2 con-box" style="padding: 20px 0;"><img src="img/coming-soon.png"></div>
     </div>
     <div class="tab_con none">
          <div class="act-start3">
	          <div class="con-box act-box3">
	               <div class="endmask" style="display: none"></div>
	               <div class="con-title">周年庆快乐&nbsp;&nbsp;人人有礼</div>
	               <div class="turn" style="width: 8.28rem;margin: 0.45rem auto;position: relative;">
	                    <img class="run-turn" src="img/turn_table.png">
	                    <div class="btn-run" style=""><img src="img/btn_click.png"></div>
	               </div>
	               <div class="" style="color: #9a1d21;font-size: 16px;text-align: center;margin-top: 1.12rem;">剩余抽奖次数： <span class="residue"></span></div>
	               <div class="btn-invite3"><img src="img/2nd_invite3.png"></div>
	          </div>
	          <div class="con-box" style="margin-top: 0.54rem;margin-bottom: 1.04rem;">
	               <div class="con-title">活动规则</div>
	               <table class="act_rules">
	                   <tr>
	                       <td class="ver-top">1、</td>
	                       <td>所有注册用户每天可免费获取一次抽奖机会，免费抽奖机会优先使用，仅当天有效，过期作废。 </td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">2、</td>
	                       <td>用户通过平台任一【邀请好友】按钮，成功邀请一位好友进行注册并且首次投资任意标的（除随存宝），邀请人除了获得平台奖励“10+40现金券”外，还可获得一次“宝箱大探险”开启“青铜宝箱”机会+一次“2周年快乐”抽奖机会（抽奖获取奖励翻倍）；抽奖机会可累计叠加，活动结束后抽奖机会清零，请尽快使用；</td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">3、</td>
	                       <td>红包将在抽中后自动发送您的红包账户中；理财金将自动投资7%年化收益的定期产品，为您理 财3天，3天后产生收益自动存入随存宝中； </td>
	                   </tr>
	                   <tr>
	                       <td class="ver-top">4、</td>
	                       <td>红包使用说明 
	                           <table>
	                                <tr>
	                                    <td class="ver-top">①</td>
	                                    <td>5元现金券：有效期为15天，投资8000元60天以上可使用;<br/>10元现金券：有效期为15天，投资8000元120天以上可使用；</td>
	                                </tr>
	                                <tr>
	                                    <td class="ver-top">②</td>
	                                    <td>0.3%加息券：有效期为15天，投资>20天以上使用;<br/>0.5%加息券：有效期为15天，投资>20天以上使用；<br/>1%加息券：有效期为15天，投资>20天以上使用。</td>
	                                </tr>
	                           
	                           </table>   
	                       </td>
	                   </tr>
	                  
	               </table>
	          </div>
          </div>
          <div class="act-nobegin3 con-box" style="padding: 20px 0;display: none;"><img src="img/coming-soon.png"></div>
     </div>
</div>
<!-- - 第一个活动弹窗 - -->
<div class="mask"></div>
<div class="mask1"></div>
<div class="act_popup1 popup" style="display: none;">
     <div class="get_enough1" style="text-align: center;display: none;">
	    <div><img src="img/icon_gift1.png" style="width: 1.40rem;"></div>
	    <div class="light-pro">红包已兑换</div>
	    <div class="dark-pro">请至“我的红包”查看</div>
     </div>
     <div class="no_enough1" style="text-align: center;">
        <div class="light-pro">邀请豆不足<br/>快快召唤好友！</div>
     </div>
</div>
<!-- - 第二个活动弹窗 - -->
<div class="popup act_popup2" style="display: none;">
     <div class="popup2-noenough" style="display: none;">
	    <div class="light-pro">当前积分不足</div>
	    <!-- - 开启青铜宝箱积分不足时弹框 - -->
	    <div class="dark-pro bronzebox-tips">投资或邀请好友赢取机会</div>
	    <!-- - 开启其他宝箱积分不足时弹框 - -->
	    <div class="dark-pro otherbox-tips">投资赚取积分</div>
	    <div class="btn_act2close">好的</div>
     </div>
     <div class="popup2-enough">
        <div class="light-pro popup2-title">恭喜您获得210元现金券</div>
        <div class="dark-pro popup2-see">请至“我的红包”查看</div>
        <div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;">
             <img src="img/opend_box.png">
             <div class="box_prize"><img src="img/2nd_cash210.png"></div>
        </div>
        <div class="btn_act2close">好的</div>
     </div>
</div>

<div class="act_popup21" style="min-height: 500px;overflow: auto;color: #9a1d21;">
     <div class="act_popup21close"><img src="img/btn-close.png"></div>
     <div style="text-align: center;margin: 20px;font-size: 18px;">我的礼品</div>
     <div class="flex bill-tab">
		 <div class="flex-1 txt-left">获得礼品</div>
		 <div class="flex-1 txt-right">消耗积分/时间</div>
	 </div>
	 <!-- <div style="font-size: 18px;color: #555;text-align: center; padding:20px 0;">
			您还没有获得奖励哦，<br/>赶快来参加吧!
	 </div> -->
	 <table style="width: 100%;line-height: 1.5;">
		 <c:choose>
			<c:when test="${myActivityGiftList != null && fn:length(myActivityGiftList) > 0 }">
				<c:forEach items="${myActivityGiftList }" var="actJoin">
				    <c:if test="${actJoin.summary != null && fn:length(actJoin.summary) > 0 }">
						<tr>
							<td class="txt-left">${actJoin.couponDesc }</td>
							<td class="txt-right">
								<div>${actJoin.consume }</div>
	                            <div>${actJoin.gmtcreate }</div>
	                        </td>
						</tr>
				    </c:if>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="2" style="font-size: 18px;color: #555;text-align: center; padding:20px 0;">您还没有获得奖励哦，<br/>赶快来参加吧!</td>
				</tr>
			</c:otherwise>
		</c:choose>
	 </table>
</div>
<!-- - 第三个活动弹窗 - -->
<div class="popup act_popup3">
     <div class="get_enough3" style="text-align: center;display: none;">
	    <div><img src="img/icon_gift2.png" style="width: 1.40rem;"></div>
	    <div class="light-pro popup3-title">恭喜您获得10元现金券</div>
	    <div class="dark-pro popup3-see">请至“我的红包”查看</div>
     </div>
     <div class="no_enough3" style="text-align: center;display: none;">
        <div style="color: #9a1d21;font-size: 16px;">抽奖次数已用完<br/>邀请好友赢取机会！</div>
     </div>
</div>
<!-- - 分享提示框 - -->
<div class="maskimg">
	 <img src="img/maskimg.png" />
</div>
<script>
    var isInitInviteActivity = 0;
    var isInitOpenBoxActivity = 0;
    var isInitLotteryActivity = 0;
    
    var hash = location.hash;
    if(hash){
        tab(hash.match(/\d+/)[0]);
    }
    $('.tab').click(function(){
        tab($(this).index());
        if ($(this).index() == 0) {
        	var inviteActivityNoBegin = ${inviteActivityNoBegin!=null ? inviteActivityNoBegin : 0};
        	if(inviteActivityNoBegin == '1') {
       			$('.act-start1').hide();
   				$(".act-nobegin1").show();
        	} else {
        		$('.act-start1').show();
   				$(".act-nobegin1").hide();
   				
   				if (isInitInviteActivity == 0) {
   					exchange();
        			isInitInviteActivity = 1;
   				}
   				$(".is_noward").text('${is_noward}');
        	}
        } else if ($(this).index() == 1) {
        	var openBoxActivityNoBegin = ${openBoxActivityNoBegin!=null ? openBoxActivityNoBegin : 0};
        	if(openBoxActivityNoBegin == '1') {
       			$('.act-start2').hide();
   				$(".act-nobegin2").show();
        	} else {
        		$('.act-start2').show();
   				$(".act-nobegin2").hide();
        		
        		if (isInitOpenBoxActivity == 0) {
	        		openBox();
        			isInitOpenBoxActivity = 1;
   				}
        	}
        	$(".is_noward").text('');
        } else if ($(this).index() == 2) {
        	var lotteryActivityNoBegin = ${lotteryActivityNoBegin!=null ? lotteryActivityNoBegin : 0};
        	if(lotteryActivityNoBegin == '1') {
       			$('.act-start3').hide();
   				$(".act-nobegin3").show();
        	} else {
        		$('.act-start3').show();
   				$(".act-nobegin3").hide();
   				if (isInitLotteryActivity == 0) {
        			lottery($(".residue").text());
        			isInitLotteryActivity = 1;
   				}
        	}
        	$(".is_noward").text('');
        }
    });
    function tab(index){
        $('.tab_con').siblings('.tab_con').hide().end().eq(index).show();
        $(".tab").eq(index).addClass("tab-active").siblings().removeClass("tab-active");
    };
    //将弹出框垂直居中
    function popupHeight(selector){
    	var popupHeight = $(selector).outerHeight()/2;
    	$(selector).css({
        	"marginTop": "-" + popupHeight + "px"
        });
    };
    /* $(".btn-invite1,.btn-invite2,.btn-invite3").click(function(){
    	$(".mask,.maskimg").fadeIn();
    }); */
    
    $(".btn-invite1,.btn-invite2,.btn-invite3").click(function(){
		var device = '${param.device}';
		var _channel = '${param._channel}';
		var app_token = '${param.app_token}';
		var param = {
			t :new Date(),
			app_token:app_token
		};
		$.post("anniverary_activity_login_status.htm", param, function(data) {
			if(data.loginStatus == 1) {
				if(device) {
					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=share";
				} else {
					$(".mask,.maskimg").fadeIn();
				}
			} else {
				if(device) {
					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
				} else {
					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
				}
			}
		}, "json");
	});
    
    $(".mask").click(function(){
    	$(".mask,.maskimg").fadeOut();
    });
   	function exchange() {
    $(".btn-convert").on("click",function(){
    	$(".btn-convert").attr("disabled", true);
    	var subActivityId = $(this).attr("data-type");
    	Activity.ready('${param.app_token}', "20170807", "", {
    		t:new Date()
    	}, function(data){
        		var index = 0;
    			if(!subActivityId) {
    				return;
    			}
        		var dataTtype = Number(subActivityId);
    			var device = '${param.device}';
        		var app_token = '${param.app_token}';
        		// 登陆状态
        		var currentInviteSoy = Number($(".invitesoy-numbers").text());
	    		var param = {
	    			t :new Date(),
	    			app_token:app_token
	    		};
    			$.post("anniverary_activity_login_status.htm", param, function(data) {
        			if(data.loginStatus == 1) {
        				var needInviteSoy = 0;
        				switch(dataTtype){
        					case 1: 
        						if(currentInviteSoy >= 1) {
        							index = 1;
        							needInviteSoy = 1;
        						}
        						break;
        					case 2: 
        						if(currentInviteSoy >= 2) {
        							index = 1;
        							needInviteSoy = 2;
        						}
        						break;
        					case 3: 
        						if(currentInviteSoy >= 4) {
        							index = 1;
        							needInviteSoy = 4;
        						}
        						break;
        					case 4: 
        						if(currentInviteSoy >= 8) {
        							index = 1;
        							needInviteSoy = 8;
        						}
        						break;
        					case 5: 
        						if(currentInviteSoy >= 10) {
        							index = 1;
        							needInviteSoy = 10;
        						}
        						break;
        				};
        				
        				if (index == 1) {
        					Activity.join(subActivityId, '', function(jdata){
    		    				if(jdata.code=="SUCCESS"){
        							$(".invitesoy-numbers").text(currentInviteSoy-needInviteSoy);
    	   							$(".mask,.act_popup1, .no_enough1").hide();
    	   				    		$(".mask,.act_popup1, .get_enough1").show();
    	   				    	    $(".mask,.act_popup1").fadeIn().delay(2000).fadeOut(); 
    		    				}else if(jdata.code=="token_error"){
    		    					if(device) {
    		        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
    		        				} else {
    		        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
    		        				}
    		    				}else if(jdata.code=="ACT_TIME_INVALID"){
    		    					$('.act-box1 .endmask').show();
    		    				}else if(jdata.code=="ACTIVITYDO_NOT_EXIST"){
    		    					$("#pop-content").html('<p>抱歉，网络出现异常</p>');
    		    					$(".mask, .convert-popup,.btn-convert-sure").fadeIn();
    		    				}else{
    		    					console.log("参加活动失败："+JSON.stringify(jdata));
    		    				}
    		    			});
    					} else {
    						$(".mask,.act_popup1, .no_enough1").show();
    			    		$(".mask,.act_popup1, .get_enough1").hide();
    			    	    $(".mask,.act_popup1").fadeIn().delay(2000).fadeOut(); 
    					}
	        			$(".btn-convert").attr("disabled", "");
        			} else {
        				if(device) {
        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
        				} else {
        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
        				}
        			}
        		}, "json");
    			
    		});
    		
    	});
    }
   	
   	function openBox () {
   		$(".page2-btn").on("click",function(){
   			var subActivityId = $(this).attr("data-type");
   			if(!subActivityId) {
   				return;
   			}
	    	Activity.ready('${param.app_token}', "20170814box", "", {
	    		t:new Date()
	    	}, function(data){
        		var dataType = Number(subActivityId);
    			var device = '${param.device}';
        		var app_token = '${param.app_token}';
        		var currentOpenBoxChange = Number('${anniversaryOpenBoxChangeCount }');
        		var anniversaryVcoin = Number($('.my_anniversary_vcoin').text());
        		// 登陆状态
	    		var param = {
	    			t :new Date(),
	    			app_token:app_token
	    		};
      			var showAlertInfo = "";
    			$.post("anniverary_activity_login_status.htm", param, function(data) {
        			if(data.loginStatus == 1) {
		        		var index = 0;
        				switch(dataType){
        					case 1: 
          							if(currentOpenBoxChange <= 0 && anniversaryVcoin < 300) {
          								showAlertInfo = '<div class="light-pro">当前积分不足<br/></div><div class="dark-pro bronzebox-tips">投资或邀请好友赢取机会</br></div><div class="btn_act2close">好的</div>';
          							} else {
	        							index = 1;
	        							if (currentOpenBoxChange <= 0) {
	        								anniversaryVcoin = anniversaryVcoin - 300;
	        							}
          							}
        						break;
        					case 2: 
        						if(anniversaryVcoin < 5888) {
        							showAlertInfo = '<div class="light-pro">当前积分不足<br/></div><div class="dark-pro otherbox-tips">投资赚取积分<br/></div><div class="btn_act2close">好的</div>';
          							} else {
	        							index = 1;
	        							anniversaryVcoin = anniversaryVcoin - 5888;
          							}
        						break;
        					case 3: 
        						if(anniversaryVcoin < 20000) {
        							showAlertInfo = '<div class="light-pro">当前积分不足<br/></div><div class="dark-pro otherbox-tips">投资赚取积分<br/></div><div class="btn_act2close">好的</div>';
          							} else {
	        							index = 1;
	        							anniversaryVcoin = anniversaryVcoin - 20000;
          							}
        						break;
        					case 4: 
        						if(anniversaryVcoin < 180000) {
        							showAlertInfo = '<div class="light-pro">当前积分不足<br/></div><div class="dark-pro otherbox-tips">投资赚取积分<br/></div><div class="btn_act2close">好的</div>';
          							} else {
	        							index = 1;
	        							anniversaryVcoin = anniversaryVcoin - 180000;
          							}
        						break;
        				};
        				
		    			if (index != 1) {
        			        popupHeight(".act_popup2");
        		    		$(".mask1,.act_popup2, .popup2-noenough").show();
        		    		$(".mask1,.act_popup2, .popup2-enough").hide();
        		    		$(".popup2-noenough").html(showAlertInfo);
        		    	    $(".mask1,.act_popup2").fadeIn();
        		    	    $(".btn_act2close").on("click",function(){
        		        		$(".mask1,.act_popup2").fadeOut();
        		        	});
    			    	    return;
    					}
		    			
		    			Activity.join(subActivityId, '', function(jdata){
		    				if(jdata.code=="SUCCESS"){
		    					$(".my_anniversary_vcoin").html(anniversaryVcoin);
	        		    		var alertInfo = '<div class="light-pro popup2-title">'+ jdata.join_resp + '</div>';
		    					if(subActivityId == '001') {
		    						var imgUrl = "";
		    						if (jdata.join_type == '1') {
		    							imgUrl = "2nd_cash005.png";
		    						} else if (jdata.join_type == '2') {
		    							imgUrl = "twond_cash010.png";
		    						} else if (jdata.join_type == '3') {
		    							imgUrl = "2nd_rate05.png";
		    						} else if (jdata.join_type == '4') {
		    							imgUrl = "2nd_cash050.png";
		    						}
		    						alertInfo = alertInfo + '<div class="dark-pro popup2-see">请至“我的红包”查看<br/></div>'
		    						            + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
		    						            + '<div class="box_prize"><img src="img/'+ imgUrl +'"><br/></div></div>'
		    						            + '<div class="btn_act2close">好的</div>';
		    			        } else if(subActivityId == '002'){
		    			        	var imgUrl1 = "";
		    			        	var imgUrl2 = "";
		    			        	if (jdata.join_type == '1') {
		    							imgUrl1 = "2nd_cash055.png";
		    						} else if (jdata.join_type == '2') {
		    							imgUrl2 = "2nd_jd50.png";
		    						} else if (jdata.join_type == '3') {
		    							imgUrl1 = "2nd_cash060.png";
		    						} else if (jdata.join_type == '4') {
		    							imgUrl2 = "2nd_jd100.png";
		    						}
		    			        	
		    			        	if (jdata.join_type == '1' || jdata.join_type == '3') {
		    			        		alertInfo = alertInfo + '<div class="dark-pro popup2-see">请至“我的红包”查看<br/></div>'
		    						            + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
		    						            + '<div class="box_prize"><img src="img/'+ imgUrl1 +'"><br/></div></div>'
		    						            + '<div class="btn_act2close">好的</div>';
		    			        	} else {
		    			        		alertInfo = alertInfo + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
		    						            + '<div class="box_prize"><img src="img/'+ imgUrl2 +'"><br/></div></div>'
		    						            + '<div class="btn_act2close">好的</div>';
		    			        	}
		    			        } else if(subActivityId == '003'){
		    			        	var imgUrl = "";
		    			        	if (jdata.join_type == '1') {
		    							imgUrl = "2nd_cash210.png";
		    						} else if (jdata.join_type == '2') {
		    							alertInfo = alertInfo + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
    						            + '<div class="box_prize"><img src="img/2nd_jd200.png"><br/></div></div>'
    						            + '<div class="btn_act2close">好的</div>';
		    						} else if (jdata.join_type == '3') {
		    							imgUrl = "2nd_cash255.png";
		    						} else if (jdata.join_type == '4') {
		    							imgUrl = "2nd_cash420.png";
		    						}
		    			        	
		    			        	if (jdata.join_type != '2') {
		    			        		alertInfo = alertInfo + '<div class="dark-pro popup2-see">请至“我的红包”查看<br/></div>'
		    						            + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
		    						            + '<div class="box_prize"><img src="img/'+ imgUrl +'"><br/></div></div>'
		    						            + '<div class="btn_act2close">好的</div>';
		    			        	}
		    			        } else if(subActivityId == '004'){
		    			        	var imgUrl = "";
		    			        	if (jdata.join_type == '1') {
		    							alertInfo = alertInfo + '<div class="dark-pro popup2-see">请至“我的红包”查看<br/></div>'
    						            + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
    						            + '<div class="box_prize"><img src="img/2nd_cash3200.png"><br/></div></div>'
    						            + '<div class="btn_act2close">好的</div>';
		    						} else if (jdata.join_type == '2') {
		    							imgUrl = "2nd_ipad.png";
		    						} else if (jdata.join_type == '3') {
		    							imgUrl = "2nd_uav.png";
		    						} else if (jdata.join_type == '4') {
		    							imgUrl = "2nd_iphone.png";
		    						}
		    			        	
		    			        	if (jdata.join_type != '1') {
		    			        		alertInfo = alertInfo + '<div style="position: relative;margin: 0.52rem auto 0;width: 4.05rem;"><img src="img/opend_box.png">'
		    						            + '<div class="box_prize"><img src="img/'+ imgUrl +'"><br/></div></div>'
		    						            + '<div class="btn_act2close">好的</div>';
		    			        	}
		    			        }
	        		            
		    					popupHeight(".act_popup2");
	        		    		$(".popup2-enough").html(alertInfo);
	        		    		$(".mask1,.act_popup2, .popup2-enough").show();
	        		    		$(".mask1,.act_popup2, .popup2-noenough").hide();
	        		    	    $(".mask1,.act_popup2").fadeIn();
	        		    	    $(".btn_act2close").on("click",function(){
	        		        		$(".mask1,.act_popup2").fadeOut();
	        		        		window.location.reload();//href="/laicunba-web.ext/h5/ext/activity/anniverary_activity_go_invite.htm?app_token=${param.app_token}#tab1";
	        		        	});
	        		    	    
		    				}else if(jdata.code=="token_error"){
		    					if(device) {
		        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
		        				} else {
		        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
		        				}
		    				}else if (jdata.code=="ACTIVITYDO_NOT_EXIST") {
		    					popupHeight(".act_popup2");
	        		    		$(".mask1,.act_popup2, .popup2-noenough").show();
	        		    		$(".mask1,.act_popup2, .popup2-enough").hide();
	        		    		$(".popup2-noenough").html('<div class="light-pro">当前活动不存在！<br/></div><div class="btn_act2close">好的</div>');
	        		    	    $(".mask1,.act_popup2").fadeIn();
		    				}else if(jdata.code=="ACT_TIME_INVALID"){
		    					$('.act-box2 .endmask').show();
		    				}else if(jdata.code=="ACTIVITYDO_NOT_EXIST"){
		    					$(".popup2-noenough").html('<div class="light-pro">抱歉，网络出现异常！<br/></div><div class="btn_act2close">好的</div>');
		    					$(".mask1,.act_popup2").fadeIn();
		    				}else{
		    					console.log("参加活动失败："+JSON.stringify(jdata));
		    				}
		    			});
		    			
        			} else {
        				if(device) {
        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
        				} else {
        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
        				}
        			}
        		}, "json");
	    			
	    	});
	    		
	    });
   		
   	}
   	
    //转盘旋转,各奖项对应的旋转角度及中奖公告内容
	function runCup(lotteryNum, rewardResp, rotNum){
		//旋转角度
		var angles;
		//概率
		if (lotteryNum == 1) {
			angles = 2160 * rotNum + 2005;
			setTimeout(function(){
				/* $(".get_enough3 .popup3-title").text("恭喜您，获得10元的现金券！");
				$(".get_enough3 .popup3-see").text("请至“我的红包”查看"); */
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 2) {
			angles = 2160 * rotNum + 2108;
			setTimeout(function(){
				/* $(".get_enough3 .popup3-title").text(rewardResp);
				$(".get_enough3 .popup3-see").text("请至“交易记录”查看"); */ 
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 3) {
			angles = 2160 * rotNum + 1903;
			setTimeout(function(){    				
				/* $(".get_enough3 .popup3-title").text("恭喜您，获得0.3%的加息券！");
				$(".get_enough3 .popup3-see").text("请至“我的红包”查看"); */  
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 4) {
			angles = 2160 * rotNum + 1954;
			setTimeout(function(){
				/* $(".get_enough3 .popup3-title").text("恭喜您，获得5元的现金券！");
				$(".get_enough3 .popup3-see").text("请至“我的红包”查看"); */
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut();
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 5) {
			angles = 2160 * rotNum + 1800;
			setTimeout(function(){
				/* $(".get_enough3 .popup3-title").text("恭喜您，获得1%的加息券！");
				$(".get_enough3 .popup3-see").text("请至“我的红包”查看");   */
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(3000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 6) {
			angles = 2160 * rotNum + 1851;
			setTimeout(function(){
				/*  $(".get_enough3 .popup3-title").text("恭喜您，获得0.5%的加息券！");
			    $(".get_enough3 .popup3-see").text("请至“我的红包”查看"); */
			    $(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		//概率
		else if (lotteryNum == 7) {
			angles = 2160 * rotNum + 2057;
			setTimeout(function(){
				/* $(".get_enough3 .popup3-title").text(rewardResp);
				$(".get_enough3 .popup3-see").text("请至“交易记录”查看"); */
				$(".get_enough3 .popup3-title").html(rewardResp);
				$(".get_enough3").show();
				popupHeight(".act_popup3");
				$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut(); 
				$(".btn-run").removeClass("no-click");
			},6000);
		}
		var degValue = 'rotate('+angles+'deg'+')';
   		$('.run-turn').css('-o-transform',degValue);           //Opera
   		$('.run-turn').css('-ms-transform',degValue);          //IE浏览器
   		$('.run-turn').css('-moz-transform',degValue);         //Firefox
   		$('.run-turn').css('-webkit-transform',degValue);      //Chrome和Safari
   		$('.run-turn').css('transform',degValue);
	}
	function lottery(lotteryNums){
		//旋转次数
	    var rotNum = 1;
		$(".btn-run").on("click",function(){
		   	Activity.ready('${param.app_token}', "20170814lottery", "", {
		   		t:new Date()
		   	}, function(data){
    			var device = '${param.device}';
        		var app_token = '${param.app_token}';
        		// 登陆状态
	    		var param = {
	    			t :new Date(),
	    			app_token:app_token
	    		};
	    		$.post("anniverary_activity_login_status.htm", param, function(data) {
	    			lotteryNums = lotteryNums!=null ? Number(lotteryNums) : 0;
	    			if(data.loginStatus == 1) {
		    			if (lotteryNums >= 1) {
		    				lotteryNums = lotteryNums-1;
							$(".residue").html(lotteryNums);
							//转盘旋转过程“开始抽奖”按钮无法点击
			    			$('.btn_run').attr("disabled", true);
			    			//旋转次数加一
			    			rotNum = rotNum + 1;
			    			$(".btn-run").addClass("no-click");
							
			    			Activity.join('001', '', function(jdata){
			    				if(jdata.code=="SUCCESS"){
		    						runCup(jdata.join_type, jdata.join_resp, rotNum);
			    				}else if(jdata.code=="token_error"){
			    					if(device) {
			        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
			        				} else {
			        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
			        				}
			    				}else if (jdata.code=="ACTIVITYDO_NOT_EXIST") {
			    					$(".no_enough3").html('<div style="color: #9a1d21;font-size: 16px;">当前活动不存在！</div>');
			    					$(".act_popup3").show();
			        				$(".no_enough3").show();
					    			$(".get_enough3").hide();
					    			$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut();
			    				}else if(jdata.code=="ACT_TIME_INVALID"){
			    					$('.act-box3 .endmask').show();
			    				}else if(jdata.code=="ACTIVITYDO_NOT_EXIST"){
			    					$(".no_enough3").html('<div style="color: #9a1d21;font-size: 16px;">抱歉，网络出现异常！</div>');
			    					$(".act_popup3").show();
			        				$(".no_enough3").show();
					    			$(".get_enough3").hide();
					    			$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut();
			    				}else{
			    					console.log("参加活动失败："+JSON.stringify(jdata));
			    				}
			    			});
			    			
	        			} else {
	        				$(".act_popup3").show();
	        				$(".no_enough3").show();
			    			$(".get_enough3").hide();
			    			$(".mask,.act_popup3").fadeIn().delay(2000).fadeOut();
	        			}
		    		} else{
		    			if(device) {
        					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
        				} else {
        					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
        				}
		    		}
	        	}, "json");
		   			
		   	});
	   	 });
	}
	
	function getShareInfo(){
		var title = "要理财,来存吧!";
		var summary = "来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!";
		var url = "http://8.laicunba.com/h5/regist_new.jsp?invite_code=${inviteCode}&t="+new Date()+"&is_noward=" + $(".is_noward").text();
		window.share.onSumResult(summary,title,url);
		return{
			title:title,
			summary:summary,
			url:url
		}	
	}

	function getShareInfoIOS(){
		var title = "要理财,来存吧!";
		var summary = "来存吧票据理财,注册即送18888元理财金,新手宝7天年化收益率达20%!100万小伙伴的选择,让你的每笔财富增值!";
		var url = "http://8.laicunba.com/h5/regist_new.jsp?invite_code=${inviteCode}&is_noward=" + $(".is_noward").text();
		return{
			title:title,
			summary:summary,
			url:url
		}	
	}
  
    $(function(){
    	// 活动是否开始
    	var inviteActivityNoBegin = ${inviteActivityNoBegin!=null ? inviteActivityNoBegin : 0};
    	if(inviteActivityNoBegin == '1') {
	    	if($('.tab-active') && $('.tab-active').attr('href') == '#tab0') {
    			$('.act-start1').hide();
				$(".act-nobegin1").show();
	    	}
    	}
    	var openBoxActivityNoBegin = ${openBoxActivityNoBegin!=null ? openBoxActivityNoBegin : 0};
   		if($('.tab-active') && $('.tab-active').attr('href') == '#tab1') {
    		if(openBoxActivityNoBegin == '1') {
    			$('.act-start2').hide();
				$(".act-nobegin2").show();
	    	} else {
	    		$('.act-start2').show();
				$(".act-nobegin2").hide();
	    	}
   		}
    	var lotteryActivityNoBegin = ${lotteryActivityNoBegin!=null ? lotteryActivityNoBegin : 0};
   		if($('.tab-active') && $('.tab-active').attr('href') == '#tab2') {
    		if(lotteryActivityNoBegin == '1') {
    			$('.act-start3').hide();
				$(".act-nobegin3").show();
	    	} else {
	    		$('.act-start3').show();
				$(".act-nobegin3").hide();
	    	}
    	}
    	
    	// 活动是否结束
    	var inviteActivityEnd = ${inviteActivityEnd!=null ? inviteActivityEnd : 0};
    	if (inviteActivityEnd == '1') {
    		$('.act-box1 .endmask').show();
    		if (hash) {
    			tab(hash.match(/\d+/)[0]);
    		} else {
	    		tab(1);
        		if(openBoxActivityNoBegin == '1') {
        			$('.act-start2').hide();
    				$(".act-nobegin2").show();
    	    	} else {
    	    		$('.act-start2').show();
    				$(".act-nobegin2").hide();
    	    	}
    		}
    	}
    	var openBoxActivityEnd = ${openBoxActivityEnd!=null ? openBoxActivityEnd : 0};
    	if (openBoxActivityEnd == '1') {
    		$('.act-box2 .endmask').show();
    		if (hash) {
    			tab(hash.match(/\d+/)[0]);
    		} else {
	    		tab(2);
	    		if(lotteryActivityNoBegin == '1') {
	    			$('.act-start3').hide();
					$(".act-nobegin3").show();
		    	} else {
		    		$('.act-start3').show();
					$(".act-nobegin3").hide();
		    	}
    		}
    	}
    	var lotteryActivityEnd = ${lotteryActivityEnd!=null ? lotteryActivityEnd : 0};
    	if (lotteryActivityEnd == '1') {
    		$('.act-box3 .endmask').show();
    	}
    	
    	// 集结号活动
    	if($('.tab-active') && $('.tab-active').attr('href') == '#tab0') {
    		if (isInitInviteActivity == 0) {
				exchange();
			}
    		isInitInviteActivity = 1;
    		$(".is_noward").text('${is_noward}');
    	}
    	
    	// 开启宝箱    
    	if(($('.tab-active') && $('.tab-active').attr('href') == '#tab1')) {
    		if (isInitOpenBoxActivity == 0) {
        		openBox();
			}
    		isInitOpenBoxActivity = 1;
    	}
    	
    	// 宝箱
    	$(".btn_act2close").on("click",function(){
    		$(".mask1,.act_popup2").fadeOut();
    	});
    	
    	$(".mygift").on("click",function(){
    		var device = '${param.device}';
    		var app_token = '${param.app_token}';
    		var param = {
    			t :new Date(),
    			app_token:app_token
    		};
    		$.post("anniverary_activity_login_status.htm", param, function(data) {
    			if(data.loginStatus == 1) {
    				popupHeight(".act_popup21");
    	    	    $(".mask,.act_popup21").fadeIn(); 
	    		} else{
	    			if(device) {
    					window.location.href="/h5/ext/activity/anniverary_activity_go_invite.htm?app_view=login";
    				} else {
    					window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/anniverary_activity_go_invite.htm";
    				}
	    		}
        	}, "json");
    	});
    	
    	$(".act_popup21close").click(function(){
    		$(".mask,.act_popup21").fadeOut(); 
    	})
    	//可抽奖次数
    	var lotteryNums = ${anniversaryLotteryChangeCount!=null ? anniversaryLotteryChangeCount : 0};
    	$(".residue").html(Number(lotteryNums));
    	
    	//大转盘抽奖
    	if($('.tab-active') && $('.tab-active').attr('href') == '#tab2') {
    		if (isInitLotteryActivity == 0) {
    			lottery($(".residue").text());
    		}
    		isInitLotteryActivity = 1;
	    }
    	
    	// 计算获得积分
    	$("#input_amount,#input_period").on("focus blur keyup",function(){
    		var input_amount = $("#input_amount").val();
        	var input_period = $("#input_period").val();
    		if (input_amount!='' && input_period!='') {
	    		input_amount = Number(input_amount);
	        	input_period = Number(input_period);
        	    $("#compute_result").val(Math.round(input_amount * input_period / 365));
    		}
    	});
    	
    })
    
</script>
</body>
</html>